package com.sduept.nwld.dataserver.rest.fault;

import com.alibaba.fastjson.JSONArray;
import com.sduept.bigdata.weather.manager.AwsStationManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 气象站站点信息Rest服务
 * @author Ningfw
 * @date 2017-07-05
 *
 */
@RestController
@RequestMapping("/awsStation/")
public class AwsStationServices {

	@Autowired
	private AwsStationManager awsStationManager;
	
	/**
	 * 查询全部气象站站点信息
	 * @return
	 */

	@GetMapping("/getAllAwsStation")
	public String getAllAwsStation(){
		
		JSONArray jsa = new JSONArray();
		
		List<?> awsList = awsStationManager.findAll();
		for(Object obj : awsList){
			jsa.add(obj);
		}
		return jsa.toJSONString();
	}
}
